package org.example.AI;

/**
 * @author: 默苍璃
 * @date: 2024-07-18 10:54
 */
// 非终结符表达式：乘法表达式
public class MultiplyExpression implements Expression {
    private Expression left;
    private Expression right;

    public MultiplyExpression(Expression left, Expression right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public int interpret(Context context) {
        return left.interpret(context) * right.interpret(context);
    }

}